package com.example.demo.huawei;

import java.util.*;

/*
围棋的气
 */
public class OD58 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s1 = scanner.nextLine();
        String s2 = scanner.nextLine();
        // 黑棋坐标
        List<String> blackList = new ArrayList<>();
        // 白棋坐标
        List<String> whiteList = new ArrayList<>();

        // 黑棋坐标+气坐标
        Set<String> blackSetQ = new HashSet<>();
        // 白棋坐标+气坐标
        Set<String> whiteSetQ = new HashSet<>();

        String[] split = s1.split("\\s");
        for (int i = 0; i < split.length; i += 2) {
            blackList.add(split[i] + "_" + split[i + 1]);
        }
        String[] split2 = s2.split("\\s");
        for (int i = 0; i < split2.length; i += 2) {
            whiteList.add(split2[i] + "_" + split2[i + 1]);
        }

        for (String s : blackList) {
            String[] split1 = s.split("_");
            int x = Integer.parseInt(split1[0]);
            int y = Integer.parseInt(split1[1]);
            // 角点 4个
            if (x == 0 && y == 0) {
                blackSetQ.add(x + "_" + (y + 1));//0_1
                blackSetQ.add((x + 1) + "_" + y);// 1_0
            } else if (x == 0 && y == 18) {
                blackSetQ.add(x + "_" + (y - 1));//0_17
                blackSetQ.add((x + 1) + "_" + y);// 1_18
            } else if (x == 18 && y == 0) {
                blackSetQ.add(x + "_" + (y + 1));//18_1
                blackSetQ.add((x - 1) + "_" + y);// 17_0
            } else if (x == 18 && y == 18) {
                blackSetQ.add(x + "_" + (y - 1));
                blackSetQ.add((x - 1) + "_" + (y));
            } else if (y == 0) {
                blackSetQ.add(x + "_" + (y + 1));//0_1
                blackSetQ.add((x + 1) + "_" + y);// 1_0
                blackSetQ.add((x - 1) + "_" + y);// 1_0
            } else if (x == 0) {
                blackSetQ.add(x + "_" + (y + 1));//0_1
                blackSetQ.add(x + "_" + (y - 1));//0_1
                blackSetQ.add((x + 1) + "_" + y);// 1_0
            } else {
                blackSetQ.add(x + "_" + (y + 1));//0_1
                blackSetQ.add(x + "_" + (y - 1));//0_1
                blackSetQ.add((x + 1) + "_" + y);// 1_0
                blackSetQ.add((x - 1) + "_" + y);// 1_0
            }
        }

        for (String a : whiteList) {
            blackSetQ.remove(a);
        }
        for (String a : blackList) {
            blackSetQ.remove(a);
        }

        for (String s : whiteList) {
            String[] split1 = s.split("_");
            int x = Integer.parseInt(split1[0]);
            int y = Integer.parseInt(split1[1]);
            // 角点 4个
            if (x == 0 && y == 0) {
                whiteSetQ.add(x + "_" + (y + 1));//0_1
                whiteSetQ.add((x + 1) + "_" + y);// 1_0
            } else if (x == 0 && y == 18) {
                whiteSetQ.add(x + "_" + (y - 1));//0_17
                whiteSetQ.add((x + 1) + "_" + y);// 1_18
            } else if (x == 18 && y == 0) {
                whiteSetQ.add(x + "_" + (y + 1));//18_1
                whiteSetQ.add((x - 1) + "_" + y);// 17_0
            } else if (x == 18 && y == 18) {
                whiteSetQ.add(x + "_" + (y - 1));
                whiteSetQ.add((x - 1) + "_" + (y));
            } else if (y == 0) {
                whiteSetQ.add(x + "_" + (y + 1));//0_1
                whiteSetQ.add((x + 1) + "_" + y);// 1_0
                whiteSetQ.add((x - 1) + "_" + y);// 1_0
            } else if (x == 0) {
                whiteSetQ.add(x + "_" + (y + 1));//0_1
                whiteSetQ.add(x + "_" + (y - 1));//0_1
                whiteSetQ.add((x + 1) + "_" + y);// 1_0
            } else {
                whiteSetQ.add(x + "_" + (y + 1));//0_1
                whiteSetQ.add(x + "_" + (y - 1));//0_1
                whiteSetQ.add((x + 1) + "_" + y);// 1_0
                whiteSetQ.add((x - 1) + "_" + y);// 1_0
            }
        }
        for (String a : blackList) {
            whiteSetQ.remove(a);
        }
        for (String a : whiteList) {
            whiteSetQ.remove(a);
        }

        System.out.println(blackSetQ.size() + " " + whiteSetQ.size());
    }



}
